<template>
  <div class="info" @click="openDetail()">
    <div class="date">
      <div class="day">{{ day }}</div>
      <div class="month">{{ month }}</div>
    </div>
    <div class="title">{{ info.title }}</div>
  </div>
</template>

<script>
export default {
  props: {
    info: Object
  },
  data() {
    return {
      month: '',
      day: ''
    }
  },
  mounted() {
    let time = this.info.add_time.split('-')
    this.day = time[2]
    this.month = time[0] + '-' + time[1]
  },
  methods: {
    openDetail() {
      this.$router.goto({
        path: '/articleDetail',
        query: {
          id: this.info.article_id
        }
      })
    }
  }
}
</script>

<style lang="less" scoped>
.info {
  height: 150px;
  overflow: hidden;
  padding: 40px 10px 0 10px;
  cursor: pointer;
  overflow: hidden;
  &:hover {
    .title {
      color: @base-color;
    }
    .date {
      color: @base-color;
    }
  }
  .date {
    width: 76px;
    float: left;
    text-align: center;
    color: #4d4025;
    transition: all 0.2s;
    .day {
      font-size: 40px;
    }
    .month {
      font-size: 18px;
    }
  }
  .title {
    float: left;
    font-size: 20px;
    line-height: 29px;
    font-weight: 700;
    padding-top: 20px;
    padding-left: 38px;
    width: 1100px;
    color: #4d4d4d;
    transition: all 0.2s;
  }
}
</style>
